package com.zhangyj.impl.component.grid.render;

import java.io.IOException;
import java.io.Writer;

import com.zhangyj.component.grid.HTMLTable;
import com.zhangyj.component.grid.render.ICellRender;
import com.zhangyj.impl.component.type.CheckBox;

public class CheckBoxCellRender implements ICellRender {

	
	public void writer(HTMLTable table, Writer writer, Object value, boolean isSelected, boolean hasFocus, int column) throws IOException {
		CheckBox cb = (CheckBox) value;
		writer.append("<td>");
		writer.append("<input type=\"checkbox\" name=\"").append(cb.getName()).append("\"");
		writer.append(" value=\"").append(cb.getValue()).append("\"/>");
		writer.append("</td>");
	}

}
